package com.xuchang.controller;


import com.xuchang.model.LoginResult;
import com.xuchang.model.R;
import com.xuchang.model.UserLoginRequestVo;
import com.xuchang.service.SysLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SysLoginController {

    @Autowired
    private SysLoginService sysLoginService;

    @PostMapping("/login")
    public LoginResult userLogin(@RequestBody UserLoginRequestVo userLoginRequestVo){
        LoginResult loginResult = sysLoginService.userLogin(userLoginRequestVo.getUsername(), userLoginRequestVo.getPassword());
        return loginResult;
    }
}
